package com.dgut.lab.util;

import java.util.HashMap;
import java.util.Map;

public class ParamUtil {

    public static Map<String,Object> queryParameterNormal(Map<String,Object> map){
        HashMap<String,Object> result = new HashMap<>();
        result.put("address",parmeterNormal(map.get("address")));
        result.put("isArea",parmeterNormal(map.get("isArea")));
        result.put("area",parmeterNormal(map.get("area")));
        result.put("condition",parmeterNormal(map.get("condition")));
        result.put("group",parmeterNormal(map.get("group")));
        result.put("minTemperature",parmeterNormal(map.get("minTemperature")));
        result.put("maxTemperature",parmeterNormal(map.get("maxTemperature")));
        result.put("username",parmeterNormal(map.get("username")));
        result.put("minDate",parmeterNormal(map.get("minDate")));
        result.put("maxDate",parmeterNormal(map.get("maxDate")));
        return result;
    }

    public static String parmeterNormal(Object object){
        String str = (String) object;
        if (str != null && str.length() > 0 && str.trim().length() > 0) {
            return str;
        }
        else return null;
    }
}
